package com.witdata.rabbit.domain;

import com.alibaba.fastjson2.JSON;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.ToString;

@Data
@Builder
@ToString
@AllArgsConstructor
public class HandleStatus {
    private Long id;
    private String recv;
    private Status status;
    private Handle handle;
    private String data;

    public enum Status {
        Waiting,
        Success,
        Fail,
        Unknown,
    }

    public static void main(String[] args) {
        String json = "{\"id\":146749375064969216,\"handle\":\"CreateContainer\",\"data\":\"{\\\"Id\\\":\\\"031239dfd228a7d563acf84cdcb4505d90936d805e633ad05b9647965b402ee7\\\",\\\"Warnings\\\":[]}\"}";
        HandleStatus handleStatus = JSON.parseObject(json, HandleStatus.class);
        System.out.println(handleStatus);
    }
}


